import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';

import '../../../../generated/assets.dart';
import '../controllers/splash_controller.dart';

class SplashView extends GetView<SplashController> {
  const SplashView({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.white,
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            // Logo
            Image.asset(
              Assets.imagesLogo,
              width: 120.w,
              height: 120.w,
            ),
            SizedBox(height: 20.w),

            // App名称
            Text(
              '博客APP',
              style: TextStyle(
                fontSize: 24.sp,
                fontWeight: FontWeight.bold,
                color: const Color(0xFF3561B9),
              ),
            ),
            SizedBox(height: 40.w),

            // 倒计时显示
            Obx(() => Text(
                  '${controller.countdown.value}',
                  style: TextStyle(
                    fontSize: 48.sp,
                    fontWeight: FontWeight.bold,
                    color: const Color(0xFF3561B9),
                  ),
                )),
            SizedBox(height: 20.w),

            // 提示文字
            Text(
              '秒后自动跳转',
              style: TextStyle(
                fontSize: 14.sp,
                color: Colors.grey[600],
              ),
            ),
          ],
        ),
      ),
    );
  }
}
